package com.akuhome.resource.entity;

import javax.validation.constraints.NotBlank;
import java.util.Objects;

public class Build {
    Integer id;
    @NotBlank(message = "名称不能为空")
    String name;

    public Build() {
    }

    public Build(String name) {
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Build build = (Build) o;
        return Objects.equals(id, build.id) &&
                Objects.equals(name, build.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name);
    }
}
